<template>
  <el-container class="index-con">
    <el-header class="index-header">
      <headerNav />
    </el-header>
    <el-main class="index-main">
      <tabs />
      <div :id="$route.name == 'home' ? '' : 'pageContent'">
        <router-view></router-view>
      </div>
    </el-main>
  </el-container>
</template>
<script>
// 导入组件
import headerNav from '../components/headerNav.vue'
import tabs from '../components/tabs.vue'

export default {
  name: 'index',
  data() {
    return {
      showclass: 'asideshow',
      showtype: false
    }
  },
 
  // 注册组件
  components: {
    headerNav,
    tabs
  },
  methods: {
    goto() {
      this.$refs.restRef.showModal()
    }
  },
  created() {
    // 监听
    this.$root.Bus.$on('toggle', value => {
      if (value) {
        this.showclass = 'asideshow'
      } else {
        setTimeout(() => {
          this.showclass = 'aside'
        }, 300)
      }
    })
  },
  beforeUpdate() { },
  // 挂载前状态(里面是操作)
  beforeMount() {
    // 弹出登录成功
  }
}
</script>
<style >
.index-header,
.index-main {
  padding: 0px;
  /* overflow: hidden; */
}
#pageContent {
  padding: 10px;
}
</style>
